%Analyze telephone numbers

[a,b] = xlsread('c:\manoj\temp\ps.xls');%read the xls file from 8x8
a = cell2str(b(:,1)');% Get the caller line
a(1:6) = []; % remove the string caller
d1=str2num(a);

a = cell2str(b(:,2)');% Calle line
a(1:6) = [];
d1=str2num(a);


c = [d d1];% merge caller & callee nmbers
kp = unique(c);%get the unique numbers
[ii,jj] = hist(sort(c),sort(kp));%run histogram analysis
[pii_sort,i] = sort(ii);%sort the numbers according to frequency of call
pjj_sort = jj(i);
 fid = fopen('c:\manoj\temp\tp2.txt','wt');
for i = 1:442,
fprintf(fid,'%20.0f  %5.0f \n',pii_sort(i),pjj_sort(i));
end;